﻿using Ue.Infrastructure.DomainBase;
using Ue.Qcdz.Domain.Tags;

namespace Ue.Qcdz.Domain.Articles
{
    public class Article : EntityBase
    {
        public Article(object key) : base(key) { }
        public Article(Tag tag)
            : this(null, tag) { }
        public Article(object key, Tag tag)
            : base(key)
        {
            this.Tag = tag;
        }

        public string Title { get; set; }
        public string TitleColor { get; set; }
        public string Summary { get; set; }
        public string SubTitle { get; set; }
        public string ImageUrl { get; set; }
        public string Content { get; set; }
        public int ClickCount { get; set; }
        public string Keyword { get; set; }
        public string Editor { get; set; }
        public string Reference { get; set; }
        public string Remark { get; set; }
        public int Status { get; set; }
        public string Ver { get; set; }
        public int IsTop { get; set; }
        public int DisplayOrder { get; set; }
        public bool IsStrong { get; set; }
        public string Relevance { get; set; }
        public int IsFocus { get; set; }

        public Tag Tag { get; set; }

        public void SetIsTop()
        {
            this.IsTop = this.IsTop == 1 ? 0 : 1;
        }
        public void SetClickCount()
        {
            this.ClickCount++;
        }

    }
}
